You're viewing old version number 4. - Current version

2 min

Article Preview README.md

Article Preview creates HTML pages.

Test site: http://article.soupmode.com

Markup is submitted, and a formatted HTML page is returned.

Custom CSS can be used to override the default CSS.

The markup can contain Markdown, Multimarkdown, or Textile, along with HTML.

The markup chosen depends upon how the title line is created. The title line is the first line in the markup. If it begins with a pound sign, the markup uses Markdown/MultiMarkdown. If the title line begins with h1., then the markup uses Textile.

Commands that can be used within the markup:

  • css. (code) css..
  • more.
  • toc=yes|NO
  • using_css=YES|no
  • tint_image_header=yes|NO
  • title_over_image=yes|NO
  • publish_info_at_top=yes|NO
  • url_to_link=YES|no
  • hashtag_to_link=yes|NO
  • newline_to_br=YES|no
  • headings_as_links=yes|NO
  • aside=text
  • imageheader=url
  • largeimageheader=url

Article Preview can also be accessed through its API, but it requires JSON to be posted. To-Do: create an API option that permits a urlencoded POST request.

Only two JSON name fields need to be submitted, which include markup and submit_type.

The API endpoint for the test site is:
http://article.soupmode.com/api/v1/posts

Example:

curl -X POST -H "Content-Type: application/json" --data 'curl -X POST -H "Content-Type: application/json" --data '{"markup":"# Morning notes for Fri, Jan 22, 2016\r\n\r\n*created at 9:15 a.m.* - **updated at 3:40 p.m.** - It was an overcast morning with temps in the low to mid 20s and light wind. Some very light snow fell around daybreak. Another area of light snow should move into Toledo this morning. The snow area came from the east off of Lake Erie.\r\n\r\nmore.\r\n\r\n## 3:40 p.m.\r\n\r\nMostly sunny. Temps near 30 degrees.\r\n\r\n\r\n## 2:50 p.m.\r\n\r\nCloud cover has broken up some over the past 30 minutes. Sky now is partly sunny. Temps were in the upper 20s. Wind speeds have increased during the late morning and early afternoon.\r\n\r\n\r\n## 1:46 p.m\r\n\r\n![](https://c2.staticflickr.com/2/1506/24435045222_e520b5f886_o.gif)\r\n","submit_type":"Preview"}' http://article.soupmode.com/api/v1/posts

Returned JSON:

{
  "status":200,
  "description":"OK",
  "author":"Nick Adams",
  "title":"Morning notes for Fri, Jan 22, 2016",
  "created_time":"15:47:35 Z",
  "created_date":"Wed, 02 Mar 2016",
  "post_type":"article",
  "reading_time":0,
  "word_count":101,
  "more_text_exists":1,
  "tags":[],
  "toc":0,
  "title_over_image":0,
  "tint_header_image":0,
  "publish_info_at_top":0,
  "using_css":1,
  "custom_css":""
  "text_intro":"created at 9:15 a.m. - updated at 3:40 p.m. - It was an overcast morning with temps in the low to mid 20s and light wind. Some very light snow fell around daybreak. Another area of light snow should move into Toledo this morning. The snow area came from the east off of Lake Erie.",

"html":"

created at 9:15 a.m. - updated at 3:40 p.m. - It was an overcast morning with temps in the low to mid 20s and light wind. Some very light snow fell around daybreak. Another area of light snow should move into Toledo this morning. The snow area came from the east off of Lake Erie.

\n\n

\n\n

3:40 p.m.

\n\n

Mostly sunny. Temps near 30 degrees.

\n\n

2:50 p.m.

\n\n

Cloud cover has broken up some over the past 30 minutes. Sky now is partly sunny. Temps were in the upper 20s. Wind speeds have increased during the late morning and early afternoon.

\n\n

1:46 p.m

\n\n

\"\"

\n" }

From JR's : articles
463 words - 3398 chars - 2 min read
created on
updated on - #
source - versions



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: Nov 15, 2024 - 10:55 a.m. EST